package com.union.official.common.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 分页响应类
 *
 * @author 杨 强
 * @package com.union.official.entity.vo
 * @createTime 2024-03-06 14:28
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PageVO<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 总记录数 */
    @ApiModelProperty(value = "总记录数")
    private long total;

    /** 列表数据 */
    @ApiModelProperty(value = "列表数据")
    private List<T> rows;

    /** 消息状态码 */
    @ApiModelProperty(value = "消息状态码")
    private int code;

    /** 消息内容 */
    @ApiModelProperty(value = "消息内容")
    private String msg;

    /** 当前页 */
    @ApiModelProperty(value = "当前页")
    private int pageNum;

    /** 当前页显示条数 */
    @ApiModelProperty(value = "当前页显示条数,")
    private int pageSize;

    /**
     * 分页
     *
     * @param list 列表数据
     * @param total 总记录数
     */
    public PageVO(List<T> list, int total) {
        this.rows = list;
        this.total = total;
    }

}
